#!/bin/bash
#centos8��������ԭ.sh
# ���ذ���yumԴ

#  �޸�yum��reposĿ¼�ļ�
cd /etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# �޸����е�CentOS�ļ�����

 # Ҳ�����޸ĸ���yumԴΪ���°����Ƶ�Դ
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo



wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo


wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
#ˢ������ԭhttp://mirrors.aliyun.controller/repo/Centos-8.repo?spm=a2c6h.25603864.0.0.3d975969YB3gSq
yum clean all && makecache
yum makecache

sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*








cp /root/Centos-vault-8.5.2111.repo ./



DNS��������ַ����
�޸�/etc/resolv.conf����resolv.conf�е�name server �����Ϊ��ȷ��DNS ��ַ
vim /etc/resolv.conf
nameserver 8.8.8.8
#��resolv.conf�ļ��������������
nameserver 114.114.114.114
nmcli c reload

vim /etc/sysconfig/network-scripts/ifcfg-eth0
PEERDNS=no
DNS1=114.114.114.114
DNS2=8.8.8.8

ping mirrors.aliyun.com
114.114.114.114

ping www.baidu.com


ping 172.30.33.236











mkfs.vfat -n "sd"  /dev/mmcblk1
mkdir -p sd

mkdir -p sdk

mount  /dev/mmcblk1 /mnt/sd
UUID=74CD-8585 /mnt/sd vfat defaults 0 2

sync
echo "Done"

echo "Start copy system for eMMC."

# java�����
# 1 ��ѹ

JAVA_HOME



export JAVA_HOME=/opt/java/jdk-18.0.2.1
export PATH=$JAVA_HOME/bin:$PATH

source /etc/profile

java -version
export CATALINA_HOME=/usr/local/java/apache-tomcat-7.0.100

tar czvf /mnt/java-1-8-0-342.tar.gz ./*

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar


